<template>
  <div class="dong-card" :style="width ? { width: width + 'px' } : {}">
    <!-- 卡片图片 -->
    <div class="dong-card-img" :style="imgHeight ? { imgHeight: imgHeight + 'px' } : {}">
      <img :src="imgSrc" alt="img" />
    </div>
    <!-- 卡片描述 -->
    <div class="dong-card-summary" v-if="summary">
      {{ summary }}
    </div>
    <div class="dong-card-summary" v-else>
      <slot />
    </div>
    <!-- 卡片footer -->
    <div class="dong-card-footer" v-if="$slots.footer">
      <slot name="footer" />
    </div>
  </div>
</template>

<script setup>
import propObj from './props'
defineProps(propObj)
defineOptions({
  name: 'DongCard',
})
</script>

<style lang="scss" scoped></style>
